﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace DH.MQ
{
    [XmlRootAttribute("RabbitMQConfig", IsNullable = false)]
    public class XMLConfig : ConfigSetting
    {
        [XmlAttribute("VHost")]
        public string VHost { get; set; }
        [XmlAttribute("IsAck")]
        public bool IsAck { get; set; }
        [XmlAttribute("IsDurability")]
        public bool IsDurability { get; set; }
        [XmlAttribute("User")]
        public string User { get; set; }
        [XmlAttribute("PWD")]
        public string PWD { get; set; }
        [XmlAttribute("Type")]
        public string Type { get; set; }

        [XmlArrayAttribute("Exchanges")]
        public Exchange[] exchanges { get; set; }

    }
    [XmlRootAttribute("Exchange", IsNullable = false)]
    public class Exchange
    {
        [XmlAttribute("Name")]
        public string Name { get; set; }
        [XmlArrayAttribute("Queues")]
        public Queue[] queues { get; set; }
        //[XmlArrayAttribute("DelayQueue")]
        //public DelayQueue[] delayqueues { get; set; }
    }
    public class Queue
    {
        [XmlAttribute("Name")]
        public string Name { get; set; }
        [XmlAttribute("RoutingKey")]
        public string RoutingKey { get; set; }
    }
    ///// <summary>
    ///// 延迟队列
    ///// </summary>
    //public class DelayQueue
    //{
    //    [XmlAttribute("Name")]
    //    public string Name { get; set; }
    //    [XmlAttribute("RoutingKey")]
    //    public string RoutingKey { get; set; }
    //    [XmlAttribute("MainQueue")]
    //    public string MainQueue { get; set; }
    //    [XmlAttribute("DelayTime")]
    //    public string DelayTime { get; set; }
    //}
}
